luci-app-natmap: sync with natmap package
authorRay Wang <[email protected]>
Sat, 23 Aug 2025 04:01:56 +0000 (12:01 +0800)
committerPaul Donald <[email protected]>
Sun, 28 Sep 2025 13:11:25 +0000 (15:11 +0200)
Signed-off-by: Ray Wang <[email protected]>
applications/luci-app-natmap/htdocs/luci-static/resources/view/natmap.js

index a602ec063554eecb7a4f1b23124cb2473fad9c5a..6c01d889e10ba41322e325c54822cba08753659b 100644 (file)
@@ -76,24 +76,38 @@ return view.extend({
                o.modalonly = true;
 
                o = s.option(form.Value, 'interval', _('Keep-alive interval'));
+               o.datatype = 'and(uinteger, min(1))';
+               o.modalonly = true;
+
+               o = s.option(form.Value, 'stun_cycle', _('STUN check cycle'), _('For UDP mode'));
                o.datatype = 'uinteger';
                o.modalonly = true;
+               o.depends('udp_mode', '1');
 
                o = s.option(form.Value, 'stun_server', _('STUN server'));
-               o.datatype = 'host';
+               o.datatype = 'string';
                o.modalonly = true;
                o.optional = false;
                o.rmempty = false;
 
                o = s.option(form.Value, 'http_server', _('HTTP server'), _('For TCP mode'));
-               o.datatype = 'host';
+               o.datatype = 'string';
                o.modalonly = true;
                o.rmempty = false;
 
+               o = s.option(form.Value, 'fwmark', _('Fwmark'),
+                               _('Mark fwmark for STUN/HTTP outbound traffic'));
+               o.datatype = 'string';
+               o.modalonly = true;
+
                o = s.option(form.Value, 'port', _('Bind port'));
-               o.datatype = 'portrange';
+               o.datatype = 'or(port, portrange)';
                o.rmempty = false;
 
+               o = s.option(form.Flag, 'port_random', _('Randomly allocation ports'),
+                               _('Allocation bind ports randomly instead of sequentially.'));
+               o.modalonly = true;
+
                o = s.option(form.Flag, '_forward_mode', _('Forward mode'));
                o.modalonly = true;
                o.ucioption = 'forward_target';
@@ -112,6 +126,16 @@ return view.extend({
                o.modalonly = true;
                o.depends('_forward_mode', '1');
 
+               o = s.option(form.Value, 'forward_timeout', _('Forward timeout'));
+               o.datatype = 'and(uinteger, min(1))';
+               o.modalonly = true;
+               o.depends('_forward_mode', '1');
+
+               o = s.option(form.Value, 'forward_congestion', _('Congestion control'), _('For TCP mode'));
+               o.datatype = 'string';
+               o.modalonly = true;
+               o.depends({'_forward_mode': '1', 'udp_mode': '0'});
+
                o = s.option(form.Value, 'notify_script', _('Notify script'));
                o.datatype = 'file';
                o.modalonly = true;